# -*- coding: utf-8 -*-
# @Time     : 2021/12/1 14:04
# @Author   : wljess
# @File     : 使用面向对象的方式创建线程.py
# @Describe : 
# @Software : PyCharm

from threading import Thread


class MyThread(Thread):

    def __init__(self, x, y):
        self.x = x
        self.y = y
        super().__init__()

    def run(self):
        print(f"面向对象的方式创建进程...")
        print(self.x + self.y)
        print(f"子线程运行结束...")


t = MyThread(100, 20)
t.start()
print("主线程运行结束...")